<html>
<head><meta charset="utf-8"><title>Is there a `try!(..) to ..?` conversion script · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html">Is there a `try!(..) to ..?` conversion script</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="175050581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175050581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175050581">(Sep 06 2019 at 10:02)</a>:</h4>
<p>And in general is there a ready to use tool to do such transformations?</p>



<a name="175056720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175056720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175056720">(Sep 06 2019 at 11:51)</a>:</h4>
<p>I thought <code>cargo fix</code> would do it, but it prefers <code>r#try!</code> instead</p>



<a name="175060385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175060385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175060385">(Sep 06 2019 at 12:45)</a>:</h4>
<p>IIRC it's supposed to be handled by <code>rustfmt</code> and the <code>use_try_shorthand</code> option</p>



<a name="175092173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175092173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175092173">(Sep 06 2019 at 18:44)</a>:</h4>
<p><span class="user-mention" data-user-id="131070">@Luca Barbato</span> <a href="https://github.com/japaric-archived/untry" target="_blank" title="https://github.com/japaric-archived/untry">https://github.com/japaric-archived/untry</a> also exists</p>



<a name="175135704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175135704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175135704">(Sep 07 2019 at 10:38)</a>:</h4>
<p>thank you a lot :)</p>



<a name="175145352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175145352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175145352">(Sep 07 2019 at 15:48)</a>:</h4>
<p>The conversion isn’t always equivalent so cargo fix cannot apply that without breaking code. And not breaking code is its primary requirement.</p>



<a name="175198521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Is%20there%20a%20%60try%21%28..%29%20to%20..%3F%60%20conversion%20script/near/175198521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tshepang Lekhonkhobe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Is.20there.20a.20.60try!(.2E.2E).20to.20.2E.2E.3F.60.20conversion.20script.html#175198521">(Sep 08 2019 at 20:34)</a>:</h4>
<p><a href="http://blog.pnkfx.org/blog/2019/06/26/breaking-news-non-lexical-lifetimes-arrives-for-everyone" target="_blank" title="http://blog.pnkfx.org/blog/2019/06/26/breaking-news-non-lexical-lifetimes-arrives-for-everyone">this post</a> really make pre-mir borrowck look bad</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>